package com.park.platform.task;

import com.park.platform.service.IOperatorService;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component("addOperatorPointJob")
@EnableScheduling
public class AddOperatorPointJob {

    private static Logger logger = Logger.getLogger(AddOperatorPointJob.class);

    @Autowired
    private IOperatorService operatorService;

    @Scheduled(cron = "0 1 0 * * ?") //每天晚上凌晨1分执行，测试：0 0/1 * * * ?
    public void execute() {
        try {
            logger.info(">>>>>>>>>articleHistoryBackupJob execute...");
            operatorService.newAddOperatorPoint();
        } catch (Exception ex) {
            logger.error("articleHistoryBackupJob error!", ex);
        }
    }
}
